Problem with counting characters in javascript

welcome to shbcf.ru